<%@include file="/common/taglibs.jsp"%>
<%@ taglib prefix="order" tagdir="/WEB-INF/tags/order"%>
<%@ taglib prefix="other" tagdir="/WEB-INF/tags/other"%>
<probiz:pageHeading pageHeadingKey="salesOrderList.heading" />

<content tag="buttons">
	<authorize:authorizeResource resourceString="/order/salesOrder/blank.html?doAction=addOrder*">
		<probiz:iconBtn btnType="add" url="${ctxPath}/order/salesOrder.html?doAction=addSalesOrder" />
	</authorize:authorizeResource>
	<authorize:authorizeResource resourceString="/order/salesOrder.html?doAction=printOrderList*">
		<probiz:iconBtn btnType="print" onclick="printOrderList()" />
	</authorize:authorizeResource>
	<div class="line"></div>
	<authorize:authorizeResource resourceString="/order/salesOrder.html?doAction=addOrderNo4PickPanel*">
		<probiz:iconBtn btnType="pick" btnTextKey="salesOrder.button.pick" onclick="addOrderNo4PickPanel()" />
		<probiz:iconBtn btnType="pick_task" btnTextKey="salesOrder.button.showPickPanel" onclick="showPickPanel()" />
	</authorize:authorizeResource>
	<div class="line"></div>
	<verFunc:verFuncValidate funcKey="tag">
		<authorize:authorizeResource resourceString="/order/salesOrder/ajaxPage.html?doAction=edit*">
			<other:tagSelector selectorId="tagSelector" module="3" left="-25" applyCallbackFunc="applyTags" manageCallbackFunc="manageTags" />
		</authorize:authorizeResource>
	</verFunc:verFuncValidate>
	<authorize:authorizeResource resourceString="/tool/salesOrderExport/dialog.html?doAction=outputExcel*">
		<probiz:iconBtn btnType="export" onclick="outExcel();" />
	</authorize:authorizeResource>
</content>

<div id="orderList">
	<%@include file="include/orderSearchCriteria.jspf"%>

	<div id="orderResults" name="orderResults">
		<%--ajaxLoad file="/order/include/salesOrderListBody.jsp" --%>
		<%@include file="include/orderSearchCriteriaStorage.jspf"%>
	</div>
</div>

<%-----orderForm的div在装饰器中----%>


<%-----start:list需要加载的JS ----%>
<c:set var="ui_dialog" value="true" scope="request" />
<c:set var="ui_tabs" value="true" scope="request" />
<c:set var="ui_datepicker" value="true" scope="request" />
<c:set var="probizJs_dwr_util" value="true" scope="request"/>	
<c:set var="probizJs_regionLinkage" value="true" scope="request"/>	
<script type="text/javascript" src="${ctxPath}/scripts/probiz/order/salesOrderListForTags.js?rs=${appConfig.rs}"></script>
<script type="text/javascript" src="${ctxPath}/scripts/probiz/order/salesOrderList.js?rs=${appConfig.rs}"></script>
<%-----end:  list需要加载的JS ----%>

<%-----start:form需要加载的JS ----%>
<script type="text/javascript"	src="${ctxPath}/scripts/probiz/order/salesOrderEdit.js?rs=${appConfig.rs}"></script>
<%-----end:  form需要加载的JS ----%>


<%---------------------------------start:收款面板 -------------------------%>
<div style="display:none">
	<fmt:message key="salesOrder.payPanel.title" var="payPanelTitle"/>
	<fmt:message key="salesOrder.payPanel.button.confirm" var="payPanelButtonConfirm"/>
	<fmt:message key="salesOrder.payPanel.button.cancel" var="payPanelButtonCancel"/>
	<probiz:ui_dialog id="payPanel" width="800" height="550" title="${payPanelTitle}"
		url="${ctxPath}/order/salesOrder/blank.html?doAction=showPayPanel" buttons="'${payPanelButtonConfirm}':payOrder,'${payPanelButtonCancel}':dlgpayPanel_close" />
</div>
<%---------------------------------end:  收款面板 -------------------------%>

<%---------------------------------start:退款面板 -------------------------%>
<div style="display:none">
	<fmt:message key="salesOrder.refundPanel.title" var="refundPanelTitle"/>
	<fmt:message key="salesOrder.refundPanel.button.confirm" var="refundPanelButtonConfirm"/>
	<fmt:message key="salesOrder.refundPanel.button.cancel" var="refundPanelButtonCancel"/>
	<probiz:ui_dialog id="refundPanel" width="800" height="660" title="${refundPanelTitle}"
		url="${ctxPath}/order/salesOrder/blank.html?doAction=showRefundPanel" buttons="'${refundPanelButtonConfirm}':refundOrder,'${refundPanelButtonCancel}':dlgrefundPanel_close" />
</div>
<%---------------------------------end:  退款面板 -------------------------%>

<%---------------------------------start:发货面板 -------------------------%>
<div style="display:none">
	<fmt:message key="salesOrder.shipPanel.title" var="shipPanelTitle"/>
	<fmt:message key="salesOrder.shipPanel.button.confirm" var="shipPanelButtonConfirm"/>
	<fmt:message key="salesOrder.shipPanel.button.cancel" var="shipPanelButtonCancel"/>
	<probiz:ui_dialog id="shipPanel" width="1000" height="670" title="${shipPanelTitle}"
		url="${ctxPath}/order/salesOrder/blank.html?doAction=showShipPanel" buttons="'${shipPanelButtonConfirm}':shipOrder,'${shipPanelButtonCancel}':dlgshipPanel_close" />
</div>
<%---------------------------------end:  发货面板 -------------------------%>

<%---------------------------------start:退货面板 -------------------------%>
<div style="display:none">
	<fmt:message key="salesOrder.returnPanel.title" var="returnPanelTitle"/>
	<fmt:message key="salesOrder.returnPanel.button.confirm" var="returnPanelButtonConfirm"/>
	<fmt:message key="salesOrder.returnPanel.button.cancel" var="returnPanelButtonCancel"/>
	<probiz:ui_dialog id="returnPanel" width="1000" height="670" title="${returnPanelTitle}"
		url="${ctxPath}/order/salesOrder/blank.html?doAction=showReturnPanel" buttons="'${returnPanelButtonConfirm}':returnOrder,'${returnPanelButtonCancel}':dlgreturnPanel_close" />
</div>
<%---------------------------------end:  退货面板 -------------------------%>

<%---------------------------------start:完成订单面板 -------------------------%>
<div style="display:none">
	<fmt:message key="salesOrder.completePanel.title" var="completePanelTitle"/>
	<fmt:message key="salesOrder.completePanel.button.confirm" var="completePanelButtonConfirm"/>
	<fmt:message key="salesOrder.completePanel.button.cancel" var="completePanelButtonCancel"/>
	<probiz:ui_dialog id="completePanel" width="800" height="260" title="${completePanelTitle}"
		url="${ctxPath}/order/salesOrder/blank.html?doAction=showCompletePanel" buttons="'${completePanelButtonConfirm}':completeOrder,'${completePanelButtonCancel}':dlgcompletePanel_close" />
</div>
<%---------------------------------end:  完成订单面板 -------------------------%>

<%---------------------------------start:作废订单面板 -------------------------%>
<div style="display:none">
	<fmt:message key="salesOrder.cancelPanel.title" var="cancelPanelTitle"/>
	<fmt:message key="salesOrder.cancelPanel.button.confirm" var="cancelPanelButtonConfirm"/>
	<fmt:message key="salesOrder.cancelPanel.button.cancel" var="cancelPanelButtonCancel"/>
	<probiz:ui_dialog id="cancelPanel" width="800" height="420" title="${cancelPanelTitle}"
		url="${ctxPath}/order/salesOrder/blank.html?doAction=showCancelPanel" buttons="'${cancelPanelButtonConfirm}':cancelOrder,'${cancelPanelButtonCancel}':dlgcancelPanel_close" />
</div>
<%---------------------------------end:  作废订单面板 -------------------------%>

<%---------------------------------start:备货面板 -------------------------%>
<div style="display:none">
	<fmt:message key="salesOrder.pickPanel.title" var="pickPanelTitle"/>
	<fmt:message key="salesOrder.pickPanel.button.confirm" var="pickPanelButtonConfirm"/>
	<fmt:message key="salesOrder.pickPanel.button.cancel" var="pickPanelButtonCancel"/>
	<probiz:ui_dialog id="pickPanel" width="400" height="265" title="${pickPanelTitle}"
		url="${ctxPath}/order/salesOrder/blank.html?doAction=showPickPanel" buttons="'${pickPanelButtonConfirm}':pickOrder,'${pickPanelButtonCancel}':dlgpickPanel_close" />
</div>
<%---------------------------------end:  备货面板 -------------------------%>

<%---------------------------------start:订单编辑-金额预览面板 必须放在外层，否则会出现多个-------------------------%>
<div style="display:none">
	<fmt:message key="salesOrder.editPreviewPanel.title" var="editPreviewPanelTitle"/>
	<fmt:message key="salesOrder.editPreviewPanel.button.confirm" var="editPreviewPanelButtonConfirm"/>
	<fmt:message key="salesOrder.editPreviewPanel.button.cancel" var="editPreviewPanelButtonCancel"/>
	<probiz:ui_dialog id="editPreviewPanel" width="800" height="650" title="${editPreviewPanelTitle}"
		url="${ctxPath}/order/salesOrder/blank.html?doAction=showEditPreviewPanel" buttons="'${editPreviewPanelButtonConfirm}':saveOrder,'${editPreviewPanelButtonCancel}':dlgeditPreviewPanel_close" />
</div>
<%---------------------------------end:  订单编辑-金额预览面板 -------------------------%>



<script type="text/javascript">
$j(document).ready(function () {
	__FMTExtend = {
		salesOrder_selectOneOrder:"<fmt:message key="salesOrder.selectOneOrder"/>",
		salesOrderList_selectSalesOrder:"<fmt:message key="salesOrderList.selectSalesOrder"/>",
		salesOrder_processing:"<fmt:message key="salesOrder.processing"/>",
		salesOrder_process_confirmOrder_choose:"<fmt:message key="salesOrder.process.confirmOrder.choose"/>",
		salesOrder_process_completeOrder_choose:"<fmt:message key="salesOrder.process.complete.choose"/>",
		salesOrder_process_cancelOrderByAdmin_choose:"<fmt:message key="salesOrder.process.cancelOrderByAdmin.choose"/>",
		salesOrder_shipPanel_shipQuantityMustNotZero:"<fmt:message key="salesOrder.shipPanel.shipQuantityMustNotZero"/>",
		salesOrder_returnPanel_returnQuantityMustNotZero:"<fmt:message key="salesOrder.returnPanel.returnQuantityMustNotZero"/>",
		salesOrder_returnPanel_returnQuantityMustGtIncomingQuantity:"<fmt:message key="salesOrder.returnPanel.returnQuantityMustGtIncomingQuantity"/>",
		salesOrder_returnPanel_noReturnObject:"<fmt:message key="salesOrder.returnPanel.noReturnObject"/>",
		salesOrder_panel_region_needConfirm:"<fmt:message key="salesOrder.panel.region.needConfirm"/>",
		salesOrder_panel_region_needModify:"<fmt:message key="salesOrder.panel.region.needModify"/>",
		salesOrder_process_saveMemo_success:"<fmt:message key="salesOrder.process.saveMemo.success"/>",
		salesOrder_pickPanel_addOrderNos_success:"<fmt:message key="salesOrder.pickPanel.addOrderNos.success"/>",
		salesOrder_pickPanel_selectOrderNo_first:"<fmt:message key="salesOrder.pickPanel.selectOrderNo.first"/>",
		salesOrder_pickPanel_selectOrderNo_empty:"<fmt:message key="salesOrder.pickPanel.selectOrderNo.empty"/>",
		salesOrder_pickPanel_pickOrder_confirm:"<fmt:message key="salesOrder.pickPanel.pickOrder.confirm"/>",
		salesOrder_pickPanel_pickOrder_success:"<fmt:message key="salesOrder.pickPanel.pickOrder.success"/>",
		orderSku_productSkuCode:"<fmt:message key="orderSku.productSkuCode"/>",
		salesOrder_editPreviewPanel_saveSuccess:"<fmt:message key="salesOrder.editPreviewPanel.saveSuccess"/>",
		salesOrder_editPreviewPanel_saveSuccess2:"<fmt:message key="salesOrder.editPreviewPanel.saveSuccess2"/>",
		salesOrder_editPanel_handling:"<fmt:message key="salesOrder.editPanel.handling"/>",
		salesOrder_editPanel_tip_noItem_disabled:"<fmt:message key="salesOrder.editPanel.tip.noItem.disabled"/>"
	};
	$j.extend(__FMT, __FMTExtend);
	<c:choose>
		<c:when test="${not empty param.quickFilter}">
			searchOrders(true,{"quickFilter":1});
		</c:when>
		<c:otherwise>
			searchOrders(true,{});
		</c:otherwise>
	</c:choose> 
});	
function outExcel(){
	var paraData=$j("#orderListForm :input[name='multiIds']").serialize();
	window.location = "${ctxPath}/tool/salesOrderExport/dialog.html?doAction=outputExcel&" + paraData;
}
</script>

